package bcontractor.partialmeet;

import bcontractor.api.Sentence;
import bcontractor.api.SentenceSet;
import bcontractor.base.IncrementalSet;
import bcontractor.builder.Builder;
import bcontractor.builders.BuilderHelper;
import bcontractor.propositional.PropositionalSentence;

/**
 * 
 * Builder for a RemainderSet
 * 
 * @author lundberg
 * 
 */
public class RemainderSetBuilder<S extends Sentence<S>> implements Builder<RemainderSet<S>> {

    private IncrementalSet<SentenceSet<S>> elements = new IncrementalSet<SentenceSet<S>>();

    @Override
    public RemainderSet<S> build() {
        return new RemainderSet<S>(this.elements.build());
    }

    public static RemainderSetBuilder<PropositionalSentence> aRemainderSet() {
        return new RemainderSetBuilder<PropositionalSentence>();
    }

    public RemainderSetBuilder<S> with(SentenceSet<S> element) {
        return BuilderHelper.copyWith(this, "elements", this.elements.with(element));
    }
}
